<template>
  <div class="container-page-allorder">
    <van-tabs v-model="active">
      <van-tab title="全部">
        <page1 />
      </van-tab>
      <van-tab title="待付款">
        <page2 />
      </van-tab>
      <van-tab title="待发货">
        <page3 />
      </van-tab>
      <van-tab title="待收货">
        <page4 />
      </van-tab>
      <van-tab title="已完成">
        <page5 />
      </van-tab>
      <van-tab title="售后">
        <page6 />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>
import page1 from './pages/page-all'
import page2 from './pages/page-2'
import page3 from './pages/page-3'
import page4 from './pages/page-4'
import page5 from './pages/page-5'
import page6 from './pages/page-6'
export default {
  components: {
    page1,
    page2,
    page3,
    page4,
    page5,
    page6
  },
  data() {
    return {
      active: 1
    }
  },
  async mounted() {
    await this.getParams()
  },
  methods: {
    // 获取params
    async getParams() {
      const { nowPage = 0 } = this.$route.params
      this.active = nowPage
    }
  }
}
</script>

<style lang="less">
 .van-tab {
    flex-basis: calc(100% / 6)!important;
  }
</style>
